package dao;

import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class Teste {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ConnectionManneger cm = ConnectionManneger.getInstace();
		Connection conexao = cm.getConnection();
		try {
			DatabaseMetaData dbmd = conexao.getMetaData();
			System.out.println( dbmd.getDriverVersion() );
			System.out.println( dbmd.supportsANSI92FullSQL() );
			System.out.println( dbmd.supportsTransactions() );
			
			String sql = "delete from cliente where id > ?";
			
			PreparedStatement p = conexao.prepareStatement(sql);
			p.setObject(1, 5);
			
			int i = p.executeUpdate();
			
			System.out.println( i );
			
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			cm.closeConnection();
		}
	}

}
